package com.lhb;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Program: spring
 * @Description:
 * @Author: LHB
 * @Version: v0.0.1
 * @Time: 2021-08-05 13:00
 **/
public class MainClass {
	public static void main(String[] args) throws Exception {
		//创建IOC容器
		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(MainConfig.class);

		InstanceB instanceB = (InstanceB) ctx.getBean("instanceB");
		instanceB.getInstanceA().say();




		// 函数接口怎么玩的

		// 声明函数接口
       /* ObjectFactory callback = () -> {
            // 实现主要业务逻辑
            System.out.println("回调!");
            return new Object();
        };

        System.out.println("-----------------------------------");

        otherFunction(callback);*/
	}

	private static void otherFunction(ObjectFactory callback) {

		// 进行回调
		callback.getObject();
	}
}
